﻿@using Webdiyer.WebControls.Mvc;
@model Webdiyer.WebControls.Mvc.PagedList<BaseData.Model.Order>
@{
    var idx = 0;
    var stauts = "";
}

<table class="table table-hover">
    <thead>
        <tr>
            <th>
                序号
            </th>
            <th>
                订单编号
            </th>
            <th>
                订购账号
            </th>
            <th>
                订购时间
            </th>
            <th>
                订单状态
            </th>
            <th>操作</th>
        </tr>
    </thead>
    @foreach (var item in Model)
    {
        idx++;
        <tr>
            <td>
                @idx
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.OrderNo)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.AccountID)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.OrderDate)
            </td>
            <td>
                @switch (item.Status)
                {
                    case 0:
                        stauts = "已提交";
                        break;
                    case 1:
                        stauts = "配送中";
                        break;
                    case 2:
                        stauts = "已收货";
                        break;
                    case 3:
                        stauts = "退货";
                        break;
                }
                @stauts
            </td>
            <td>
                <a title="明细查看" href="/Orders/Details/@item.OrderID" data-placement="bottom" data-toggle="tooltip"><span class=" glyphicon glyphicon-eye-open"></span></a>
                @*&nbsp;&nbsp;
                    <a title="分配订单" href="javascript:Edit('@item.OrderID');" data-placement="bottom" data-toggle="tooltip"><span class=" glyphicon glyphicon-share-alt"></span></a>*@
            </td>
        </tr>
    }

</table>

<hr />
<div style="padding-top:5px; width:100%">
    <div style="float:left">共 @Model.TotalPageCount 页 @Model.TotalItemCount 条记录，当前为第 @Model.CurrentPageIndex 页</div>
    @Ajax.Pager(Model, new PagerOptions { PageIndexParameterName = "id", ShowPageIndexBox = false, PageIndexBoxType = PageIndexBoxType.DropDownList, ShowGoButton = false }, new MvcAjaxOptions { UpdateTargetId = "orderlist", DataFormId = "searchForm" }, new { style = "float:right" })

    @*@Html.Pager(Model, new PagerOptions { PageIndexParameterName = "id", ContainerTagName = "ul", CssClass = "pagination", CurrentPagerItemTemplate = "<li class=\"active\"><a href=\"#\">{0}</a></li>", DisabledPagerItemTemplate = "<li class=\"disabled\"><a>{0}</a></li>", PagerItemTemplate = "<li>{0}</li>", Id = "bootstrappager" })*@
</div>